#ifndef _PATH_H_
#define _PATH_H_

#include "common.h"

#define STATION_NUMBERS             52      //算上充电房： 0号点
#define set_map(sta, e, w, s, n)    station[sta].p_east = &station[e]

typedef enum {
    P_EAST,     //东
    P_WEST,     //西
    P_SOUTH,    //南
    P_NORTH     //北
} DIRECTION_E;


//停靠点结构体
typedef struct station
{
    struct station *p_direction[4];     //依次东西南北:0.1.2.3
    int distance[4];                    //当前点到东西南北方向的距离
    int this_station;                   //当前的点
    int target_numbers;                 //需要读取的目标个数
    
}STATION_T;

typedef struct navigation_process
{
    int cur_station;
    int next_station;
    int distance;
    DIRECTION_E robot_direction;        //机器人车头方向
    DIRECTION_E run_direction;          //机器人行使方向

}NAVI_PROCESS_T;


/*******待巡检点链表******/

//巡检点号由达到小
typedef struct task_list
{
    struct task_list *pnext;
    int station_index;
}TASK_LIST_T;

//巡检任务管理，也就是对链表的管理
typedef struct  task_list_mannager
{
    struct task_list *phead;    //链表头，也就是下一个巡检点，到达之后释放，指向下一个点
    struct task_list *ptail;    //链表尾
    
}TASK_LIST_MANAGER_T;



//extern STATION_T *start_station; 
//extern STATION_T station[52];

extern NAVI_PROCESS_T navigation;     //机器人当前时刻的位置

void global_map_create(void);
void show_map(void);

void insert_a_station(int sta);
void insert_all_stations(void);
int get_next_station(void);
void show_task_station(void); 

ACTION_TYPE get_path_station(void);

#endif

